package com.webshopping.tag;

import java.util.List;

import com.webshopping.entry.AttributeMetadata;
import com.webshopping.entry.Dict;
import com.webshopping.service.dict.DictService;

public class RadioTag extends AbastractTag{

	
	@Override
	public String genetateTag(AttributeMetadata attrMd) {
		StringBuffer sb = new StringBuffer(attrMd.getAttText()+"&nbsp;");
		List<Dict> dictData = DictService.getDictByType(attrMd.getDictType());
		System.out.println(dictData);
		for(Dict dict:dictData){
			sb.append(dict.getDictText()).append("<input type=\"radio\" name=\"")
			.append(attrMd.getAttribute()).append("\" value=\"").append(dict.getDictValue()).append("\" />");
		}
		return sb.toString();
	}
}
